const app = getApp();

const http = require('../../../utils/wx_request').default;



Page({
  data: {
    site: wx.getStorageSync('site'),
    storeList: []
  },
  onLoad: function (options) {

  },

  onShow() {
    this.shopList()
  },

  // 打电话
  dialing(e) {
    let phone = e.currentTarget.dataset.phone
    wx.makePhoneCall({
      phoneNumber: phone
    }).catch(err=>{
      console.log(err);
    })
  },

  // 获取门店列表
  shopList() {
    let me = this.data
    http.storeList({
      client_appid: wx.getStorageSync('appid')
    }).then(res => {
      let {
        data: {
          data
        }
      } = res
      this.setData({
        storeList: data
      })
    }).catch(err=>{
      console.log(err);
      
    })
  }
})
